Skip to content

feat(theme): add theme toggle (light/dark/system) with provider, hook… - #284

Merged
devJaja merged 2 commits into
Epta-Node:mainfrom
Samaro1:feat/theme-toggle
Aug 25, 2026
Merged

feat(theme): add theme toggle (light/dark/system) with provider, hook…#284
devJaja merged 2 commits into
Epta-Node:mainfrom
Samaro1:feat/theme-toggle

Conversation

@Samaro1

@Samaro1 Samaro1 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a theme system with three modes (light, dark, system) and a toggle in the top navigation. Theme choice persists to localStorage and system preference changes update the UI when in System mode. Smooth 300ms transitions and CSS variable overrides for light theme included.
Files changed

Added: ThemeContext.tsx — provider with localStorage + matchMedia listener
Added: useTheme.ts — consumer hook
Added: TopNav.test.tsx — unit test for toggle behavior
Updated: TopNav.tsx — theme toggle button (sun/moon/monitor icons), accessible role="switch" and ARIA attributes
Updated: global.css — .theme-light variable overrides and 300ms transitions
Updated: App.tsx — wrapped app in ThemeProvider
Testing

Ran frontend tests: all passed (117 tests).
Dev server running at: http://localhost:3000/
image
image

Closes #223

@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

@Samaro1 is attempting to deploy a commit to the Jaja's projects Team on Vercel.

A member of the Team first needs to authorize it.

@devJaja
devJaja self-requested a review August 22, 2026 03:58
@devJaja

devJaja commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Nice Implementation @Samaro1
the CI checks fails

Why: TypeScript compile error in TopNav.tsx (theme-cycle logic returns a plain string, not the ThemeMode type setMode expects) plus an unused import in the test file. Tests still show green because vitest skips type-checking — but the actual build is broken.

Bonus issue: no flash-prevention on load, so light-theme users will see a flicker of dark theme on every refresh.

Not mergeable as-is; needs the type fix before anything else.

@devJaja

devJaja commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

@Samaro1
fIX THE CI/ FRONTEND FAILING

@Samaro1
Samaro1 force-pushed the feat/theme-toggle branch from 5f2d45e to 94cc441 Compare August 24, 2026 22:53

@devJaja devJaja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid Implementation @Samaro1

LGTM

@devJaja
devJaja merged commit 963ad08 into Epta-Node:main Aug 25, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ui): Add Dark/Light Theme Toggle with System Preference Detection

2 participants